<#include "/common/header.html" />
<!--邮箱绑定提示-->
<input type="hidden" id="emailPoint" value="${emailPoint!''}"/>
<div class="container jy-content">
    <div class="col-md-12 padding">
        <div id="carousel-example-generic" class="carousel  slide" data-ride="carousel">
            <ol class="carousel-indicators">
                <#if mainBanners??>
                    <#list mainBanners as banner>
                        <#if banner_index == 0>
                            <li data-target="#carousel-example-generic" data-slide-to="${banner_index}" class="active"></li>
                            <#else>
                                <li data-target="#carousel-example-generic" data-slide-to="${banner_index}"></li>
                        </#if>
                    </#list>
                </#if>
            </ol>
            <div class="carousel-inner border-radius" role="listbox">
                <#if mainBanners??>
                    <#list mainBanners as banner>
                        <div class="item active">
                            <img src="${banner.picPath!''}" alt="${banner.picName!''}">
                            <div class="carousel-caption">
                                ${banner.picTitle!''}
                            </div>
                        </div>
                    </#list>
                </#if>
            </div>
            <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
                <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                <span class="sr-only">Previous</span>
            </a>
            <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
                <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                <span class="sr-only">Next</span>
            </a>
        </div>
    </div>
    <div class="col-md-8 padding">
        <div class="content-card clearfix">
            <div class="card">JAVA</div>
            <div class="card">HTML5</div>
            <div class="card">IOS</div>
            <div class="card">ANDROID</div>
            <div class="card">其他</div>
        </div>
        <div class="content-main clearfix">
            <ul class="show-area">
                <#if articles??>
                    <#list articles as article>
                        <li>
                            <div>
                                <!--校验三种情况：1.db保存的网络url 2.从网络下载到本地的photo 3.db为null，赋予默认值-->
                                <img src="<#if article.userVO.userInfoVO.avatarUrl?contains('http:')>${(article.userVO.userInfoVO.avatarUrl)}<#elseif article.userVO.userInfoVO.avatarUrl?contains('files')>http://image.jianyiblog.com/${(article.userVO.userInfoVO.avatarUrl)}<#else>/img/jianyi-default.png</#if>"/>
                                <a href="">${article.userVO.userInfoVO.userName!''}</a>
                                <span>${article.articleTime?string("yyyy-MM-dd HH:mm:ss")}</span>
                            </div>
                            <div>
                                <a href="/article/findArticleById/${article.id}">${article.articleName!''}</a>
                                <p>${article.description!''}</p>
                                <img src="${article.imgUrl!'/img/jianyi-default.png'}"/>
                            </div>
                            <div class="clearfix jy-static">
                                <#if article.collected><a href="#" disabled="disabled">已收藏</a>
                                    <#else><a href="#" onclick="INDEX.iWantCollect('${article.id}',this)">我要收藏</a>
                                </#if>
                                <a href="/article/findArticleById/${article.id}" title="查看">${article.viewCount!'0'}</a>
                                <a href="/article/findArticleById/${article.id}"
                                   title="评论">${article.commentCount!'0'}</a>
                                <#if article.praised><a class="nice" data-n="" onclick="INDEX.pariseOrCancelPrise(this)"  parised-id="${article.parisedId!''}"
                                                        data-relativeId="${article.id}"><img
                                        src="img/parised.png"/><span>${article.parisedCount!'0'}</span></a>
                                    <#else><a class="nice" data-n="nice" onclick="INDEX.pariseOrCancelPrise(this)" parised-id="${article.parisedId!''}"
                                              data-relativeId="${article.id}"><img src="img/parise.png"/><span>${article.parisedCount!'0'}</span></a>
                                </#if>

                            </div>
                        </li>
                    </#list>
                </#if>
            </ul>
            <button type="button" id="load_more" data-page="1" data-loading-text="加载中···"
                    class="btn btn-default btn-block center-block jy-font-green" autocomplete="off">加载更多
            </button>
        </div>
    </div>
    <div class="col-md-4">
        <div class="content-card-r">
            <iframe src="${basePath}/time-pluging/calendar.html" width="100%" height="400px"
                    frameborder="none"></iframe>
            <div id="carousel-example-generic-sm" class="carousel carousel-sm slide" data-ride="carousel-sm">
                <ol class="carousel-indicators">
                    <#if secondBanners??>
                        <#list secondBanners as banner>
                            <#if banner_index == 0>
                                <li data-target="#carousel-example-generic-sm" data-slide-to="${banner_index}" class="active"></li>
                                <#else>
                                    <li data-target="#carousel-example-generic-sm" data-slide-to="${banner_index}"></li>
                            </#if>
                        </#list>
                    </#if>
                </ol>
                <div class="carousel-inner border-radius" role="listbox">
                    <#if secondBanners??>
                        <#list secondBanners as banner>
                            <div class="item active">
                                <img src="${banner.picPath!''}" alt="${banner.picName!''}">
                            </div>
                        </#list>
                    </#if>
                </div>
            </div>
        </div>

    </div>
</div>

<#include "/common/footer.html" />

<script type="text/javascript" src="${basePath}/js/plugins/layer.js"></script>
<script type="text/javascript" src="${basePath}/js/ourjs/index.js"></script>
<script type="text/javascript" src="${basePath}/js/ourjs/common/common_validate.js"></script>
<script type="text/javascript" src="${basePath}/js/utils/layer_utils.js"></script>
<script>
    (function (win, doc) {
        $('.carousel-sm').carousel({
            interval: 2000
        });
        $(doc).on('click', '.list-group-item', function () {
            win.location.href = $(this).attr('href');
        });
        $(doc).on('click', '#write-article', function () {
            win.location.href = "/article/toWriteArticle";
        });
        $('#load_more').on('click', function () {
//					var $btn = $(this).button('loading');
            //开始处理数据
            INDEX.loadData(this);
//					setTimeout(function() {
//						$btn.button('reset');
//					}, 2000);
        });
        $('.jy-static .collect').on('click', function () {
            var i = $(this).attr('data-n');
            if (i == 'collect') {
                $(this).find('img').attr('src', 'img/collected.png');
                $(this).attr('data-n', '');
            } else {
                $(this).find('img').attr('src', 'img/collect.png');
                $(this).attr('data-n', 'collect');
            }
        });
        var sopportTouch = "ontouchstart" in doc,
            tapStart = sopportTouch ? "touchstart" : "mousedown",
            tapEnd = sopportTouch ? "touchend" : "mouseup",
            searchDom = doc.getElementById('searchInput');
        searchDom.addEventListener('focus', function () {
            this.parentElement.className = 'form-search-act';
        });
        searchDom.addEventListener('blur', function () {
            this.parentElement.className = 'form-search';
        });
    })(window, document);
</script>
</body>

</html>